package com.yxw.yxnet_cd_center.common.utils;

import java.util.Random;

public class RandomCharacterUtil {

    public static String generateBatchNumber() {
        StringBuilder sb = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < 8; i++) {
            int type = random.nextInt(2);
            if (type == 0) {
                sb.append(random.nextInt(10));
            } else {
                char c = (char) ('A' + random.nextInt(26));
                sb.append(c);
            }
        }
        return sb.toString();
    }

    public static void main(String[] args) {
        String s = generateBatchNumber();
        System.out.println(s);
    }
}
